<template>
  <div>
    <div class="foot">
        <router-link to="/index" tag="div" class="foot-nav">
          <div class="font">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xiajiantou"></use>
            </svg>
          </div>
          <div class="title">
            首页
          </div>
        </router-link>
      <router-link to="/find" tag="div" class="foot-nav">
      <div class="font">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-youxuan"></use>
            </svg>
          </div>
        <div class="title">
          电商
        </div>
      </router-link>
      <router-link to="/massage" tag="div" class="foot-nav">
      <div class="font">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-xiaoxi"></use>
            </svg>
          </div>
        <div class="title">
          消息
        </div>
      </router-link>
      <!-- <div class="foot-nav" @click="shop()"> -->
      <router-link to="/shoppingcart" tag="div" class="foot-nav">
        <div class="font">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-gouwuche"></use>
            </svg>
          </div>
        <div class="title">
          购物车
        </div>
      </router-link>
      <!-- </div> -->
      <router-link to="/mine" tag="div" class="foot-nav">
      <!-- <div class="foot-nav" @click="mine()"> -->
        <div class="font">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-meituanwaimai1"></use>
            </svg>
          </div>
        <div class="title">
          我的
        </div>
      <!-- </div> -->
      </router-link>
    </div>
  </div>
</template>

<script>
import '@/assets/iconfont/iconfont.js'
import '@/assets/css/Normalize.css'
export default {
  // methods: {
  //   mine() {
  //     let token = localStorage.getItem("token")
  //     if (token) {
  //       this.$router.push("/mine")
  //     } else {
  //       this.$router.push({path:"/login" , query:{to:"/mine"}})
  //     }
  //   },
  //   shop() {
  //     let token = localStorage.getItem("token")
  //     if (token) {
  //       this.$router.push("/shoppingcart")
  //     } else {
  //       this.$router.push({ path: "/login", query: { to: "/shoppingcart" } })
  //     }
  //   }
  // },
}
</script>
<style lang="scss" >

    *{
      margin: 0px;
      padding: 0px;
    }
    .foot{
      z-index: 9999;
      .icon {
        width: .3rem;
        height: .3rem;
        vertical-align: -0.15em;
        fill: currentColor;
        overflow: hidden;
      }
      height: 1.68rem;
      line-height: 1.68rem;
      background-color: #fff;
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      display: flex;
      justify-content: space-around;
      align-items: center;
        .foot-nav{
          width: .8rem;
          box-sizing: border-box;
          height: .8rem;
          line-height: .8rem;
          border-radius: 50%;
          font-size: .2rem;
          cursor: pointer;
          display: flex;
          flex-flow: column nowrap;
          align-items: center;
          justify-content: space-around;
          &.router-link-active{
            background-color: rgb(247, 206, 56);
          }
          .font{
            flex: 1;
            width: 0.4rem;
            height: 0.4rem;
            box-sizing: border-box;
            vertical-align: middle;
          }
          .title{
            
            flex: 1;
          }
        }
    }
</style>